from geometry import *
from time import *
def rotate2d_vs_fast_rotate2d():
    num_iterations = 100000
    v = [1, 0]
    angle = 3.141592/2.0    
    t1 = clock()
    for i in range(num_iterations):
        rotate2d(v, angle)
    time1 = clock() - t1

    t1 = clock()
    for i in range(num_iterations):
        fast_rotate2d(v, 0, 1)

    time2 = clock() - t1

    print "rotate2d = %f, fast_rotate2d = %f" % (time1, time2)


    v = (1, 1)
    t1 = clock()
    for i in range(num_iterations):
        fast_rotate2d(v, 0, 1)

    time2 = clock() - t1


    angle = 3.141592/2.0    
    t1 = clock()
    for i in range(num_iterations):
        rotate2d(v, angle)
    time1 = clock() - t1


    print "rotate2d = %f, fast_rotate2d = %f" % (time1, time2)


if __name__ == '__main__':
    rotate2d_vs_fast_rotate2d()
